﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Job.Core.Imaging
{
    public class VerifyCode
    {
        private int _Length = 5;//验证码长度(默认6个验证码的长度)
        private int _FontSize = 50;//验证码字体大小(为了显示扭曲效果，默认40像素，可以自行修改)
        private int _Padding = 1;//边框补(默认1像素)
        private bool _Chaos = true;//是否输出燥点(默认不输出)
        private Color _ChaosColor = Color.LightGray;//输出燥点的颜色(默认灰色)
        private Color _BackgroundColor = Color.White;//自定义背景色(默认白色)
        private Color[] _Colors = { Color.Black, Color.Red, Color.DarkBlue, Color.Green, Color.Orange, Color.Brown, Color.DarkCyan, Color.Purple };//自定义随机颜色数组
        private string[] _Fonts = { "Arial", "Verdana" };//自定义字体数组
        private string _CodeSerial = "2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,k,m,n,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,K,M,N,P,Q,R,S,T,U,V,W,X,Y,Z";//自定义随机码字符串序列(使用逗号分隔)

        public int Length
        {
            get { return _Length; }
            set { _Length = value; }
        }
        public int FontSize
        {
            get { return _FontSize; }
            set { _FontSize = value; }
        }
        public int Padding
        {
            get { return _Padding; }
            set { _Padding = value; }
        }
        public bool Chaos
        {
            get { return _Chaos; }
            set { _Chaos = value; }
        }
        public Color ChaosColor
        {
            get { return _ChaosColor; }
            set { _ChaosColor = value; }
        }
        public Color BackgroundColor
        {
            get { return _BackgroundColor; }
            set { _BackgroundColor = value; }
        }
        public Color[] Colors
        {
            get { return _Colors; }
            set { _Colors = value; }
        }
        public string[] Fonts
        {
            get { return _Fonts; }
            set { _Fonts = value; }
        }
        public string CodeSerial
        {
            get { return _CodeSerial; }
            set { _CodeSerial = value; }
        }
    }
}
